#ifndef B2D_OPENGL_H
#define B2D_OPENGL_H

#include "GraphicEnums.h"

// Include opengl and glew
#if B2D_PLATFORM == B2D_PLATFORM_WIN32
#define GLEW_STATIC 1
#include <GL/glew.h>
#include <GL/wglew.h>
#pragma comment(lib,"opengl32.lib")
#endif

NS_B2D_BEGIN


///
/// Utility class for getting OpenGL enumeration values
///
class GLGraphicEnumConverter
{
	B2D_STATIC_CLASS(GLGraphicEnumConverter)

private:
	static const GLenum blendCoefficients[];
	static const GLenum blendFunctions[];
	static const GLenum primitiveTypes[];

public:
	static void getTextureFormat(TextureFormat format, GLenum& glFormat, GLint& glInternalFormat, GLenum& glDataType);
	static GLenum getTextureFilter(TextureFilter filter);
	static GLenum getTextureMipmapFilter(TextureFilter filter, TextureFilter mipmap);
	static GLenum getTextureWrap(TextureWrap mode);

	static GLenum getPrimitiveType(PrimitiveType primitive);
	static GLenum getBlendingCoefficient(BlendCoefficient coeff);
	static GLenum getBlendingFunction(BlendFunction func);
};

NS_B2D_END


#endif